/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package gem.controller;

import gem.gui.courses.Common;
import gem.model.core.DBEntity;

/**
 *
 * @author INVEST INTECH.COM
 */
public class Command
{
    public final DBEntity           entity;
    public final CommandType        command;
    public final String             commandParam;

    public enum CommandType
    {
        ADDNEW,
        RENAME,
        REMOVE
    }

    public Command( DBEntity entity, CommandType type, String commandParam )
    {
        this.entity = entity;
        this.command = type;
        this.commandParam = commandParam;
    }

    public Command( DBEntity entity, String type, String commandParam )
    {
        this.entity = entity;
        this.commandParam = commandParam;

        if( type.equals(Common.COMMAND_ADD))
        {
            this.command = CommandType.ADDNEW;
        }
        else if( type.equals(Common.COMMAND_REMOVE ) )
        {
            this.command = CommandType.REMOVE;
        }
        else
        {
            this.command = CommandType.RENAME;
        }

    }
}
